home *** CD-ROM | disk | FTP | other *** search
- Path: kirki.cts.com!kirki
- From: kirki@cts.com (kirk i.)
- Newsgroups: comp.lang.c++
- Subject: Visual C++ Help Needed - Serialize/ar problem
- Date: Sun, 7 Apr 1996 13:27:33 LOCAL
- Organization: SEIDCON
- Message-ID: <kirki.2.057EA280@cts.com>
- NNTP-Posting-Host: kirki.cts.com
- Summary: getting a compiler error -- ambiguous operator
- Keywords: Serialize, Visual C++
-
- Hi...newbe to OOD and Visual C++ here. I created an object that initiates 3
- edit boxes with the following intigers:
-
- int m_seed = 0;
- int m_popsize = 0;
- int m_seed10 = m_seed +10;
-
- all ...generally works well, in that the program window intiiates with the
- values 0, 0, and 10...so, the next step was to use the Serialize
- object/function to try to store and recall the three integer values after i
- change them. so, i applied the following code:
-
- // CGene2Doc serialization
-
- void CGene2Doc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- //itoa(m_seed, sSeed, 10);
- //itoa(m_popsize, sPopsize, 10);
- //itoa(m_seed, sSeed10, 10);
-
- ar << m_seed;
- ar << m_popsize;
- ar << m_seed10;
- }
- else
- {
- //ar >> sSeed;
- //ar >> sPopsize;
- //ar >> sSeed10;
- //m_seed = atoi(const char *sSeed);
- //m_popsize = atoi(sPopsize);
- //m_seed10 = atoi(sSeed10);
- }
- }
-
- when i compile, i get:
-
- D:\Work\gene2\gene2doc.cpp
- D:\Work\gene2\gene2doc.cpp(61) : error C2593: 'operator <<' is ambiguous
- D:\Work\gene2\gene2doc.cpp(62) : error C2593: 'operator <<' is ambiguous
- D:\Work\gene2\gene2doc.cpp(63) : error C2593: 'operator <<' is ambiguous
-
-
- ...what did i do wrong here?
-
- thanks in advance,
- kirk
-
-